package com.xucy.springboot.utils;

import com.xucy.springboot.entity.Person;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

/**
 * @Author xucy
 * @Date 2019-07-09 09:34
 * @Description
 **/

public class LambdaUtil {
    public static void main(String[] args) {
        test3();
    }


    public static void test1(){
        new Thread(()-> System.out.println("xucy")).start();
    }

    public static void test2(){
        Comparable<Integer> c=(a)->a-1;
        int i=c.compareTo(3);
        System.out.println(i);
    }

    public static void test3(){
        List<Person> list=new ArrayList();
        list.add(new Person(12L,"老虎","20",new Date()));
        list.forEach(a->{a.setAge("21");
            System.out.println("里面 输出"+a.getAge());});

        Iterator<Person> iterator = list.iterator();
        while (iterator.hasNext()){
           System.out.println(iterator.next().getAge());
        }

    }
}
